package com.ying.core.exception;

import com.ying.core.response.ResultCode;

public class CustomException extends RuntimeException {

    private final Integer code;

    private final String method;

    public CustomException(ResultCode resultCode, String method) {
        super(resultCode.message());
        this.code = resultCode.code();
        this.method = method;
    }

    public CustomException(Integer code, String message, String method) {
        super(message);
        this.code = code;
        this.method = method;
    }

    public Integer getCode() {
        return code;
    }

    public String getMethod() {
        return method;
    }
}
